#include "clampSide.h"

// ClampSide

ClampSide::ClampSide(const Point& dir,const ObjectModelPtr& model)
	: 	SceneObject(dir,model){
	this->rotationAngle=0;
}

ClampSide::~ClampSide(){
}

// ClampSide A

ClampSideA::ClampSideA(const Point& dir,const ObjectModelPtr& model)
	: 	ClampSide(dir,model){
}

ClampSideA::~ClampSideA(){
}

void ClampSideA::setModelMatrix(){
	this->getParent().setSubModelMatrix();

	glTranslatef(0.45,0,-0.5);
	glRotatef(rotationAngle*180/PI,0,1,0);
	glTranslatef(0.5,0,0.5);

	glRotatef(-90,0,0,1);
	glScalef(1,-1,1);
}

// ClampSide B

ClampSideB::ClampSideB(const Point& dir,const ObjectModelPtr& model)
	: 	ClampSide(dir,model){
}

ClampSideB::~ClampSideB(){
}

void ClampSideB::setModelMatrix(){
	this->getParent().setSubModelMatrix();

	glTranslatef(-0.45,0,-0.5);
	glRotatef(-rotationAngle*180/PI,0,1,0);
	glTranslatef(-0.5,0,0.5);

	glRotatef(-90,0,0,1);
}
